home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1997 #3
/
Amiga Plus CD - 1997 - No. 03.iso
/
pd
/
programmierung
/
alienbreed3d2_src
/
amos
/
256brighten.amos
/
256brighten.amosSourceCode
Wrap
AMOS Source Code
|
1997-01-31
|
2KB
|
144 lines
Reserve As Work 15,20000
Bload "ab3:includes/256pal",Start(15)
Dim R(255),G(255),B(255)
N=Start(15)
For A=0 To 255
R(A)=Deek(N) : Add N,2
G(A)=Deek(N) : Add N,2
B(A)=Deek(N) : Add N,2
Next
Erase 15
' Print "CALCULATING WATER FILE...."
'
'Reserve As Work 15,8192*8'
'N=Start(15)
'For D=16 To 1 Step -1
'TS=N
'WR=(134*D)/16
'WG=(204*D)/16
'WB=(255*D)/16
''WR=WR*$100
''WG=WG*$10
''WB=WB
'Hide On
'For A=0 To 255
'
'R=(R(A)*180)/255
'G=(G(A)*180)/255
'B=(B(A)*180)/255
'
'If D>12
' V=D-12
' R=Min(255,R+(40*V)/4)
' G=Min(255,G+(40*V)/4)
' B=Min(255,B+(40*V)/4)
'End If
'
'If D<12
' R=(R*D)/12
' G=(G*D)/12
' B=(B*D)/12
'End If
'
'DQ=10000000
'TC=0
'For Z=0 To 255
'DR=Abs(R-R(Z))
'DG=Abs(G-G(Z))
'DB=Abs(B-B(Z))
'
'ND=(DR*3)+(DG*4)+(DB*2)
'If ND<DQ Then DQ=ND : TC=Z
'Next
'
'Doke N,TC*256+TC
'Add N,2
'Next
'
'Next
'
'' For A=0 To 5
'' For B=0 To 255
'' Doke N,Deek(TS)
'' Add TS,2
''Add N,2
''Next
''Next
'
'Bsave "ab3:includes/brightenfile",Start(15) To N
Print "NOW DOING GLARE/SHADOW FILE"
Reserve As Work 15,8192*8
N=Start(15)
For D=64 To 1 Step -1
TS=N
WR=(134*D)/16
WG=(204*D)/16
WB=(255*D)/16
'WR=WR*$100
'WG=WG*$10
'WB=WB
Hide On
For A=0 To 255
R=R(A)
G=G(A)
B=B(A)
If D>32
V=D-32
R=Min(255,R+(255*V)/32)
G=Min(255,G+(255*V)/32)
B=Min(255,B+(255*V)/32)
End If
If D<33
R=(R*D)/32
G=(G*D)/32
B=(B*D)/32
End If
DQ=10000000
TC=0
For Z=0 To 255
DR=Abs(R-R(Z))
DG=Abs(G-G(Z))
DB=Abs(B-B(Z))
ND=(DR*3)+(DG*4)+(DB*2)
If ND<DQ Then DQ=ND : TC=Z
Next
Poke N,TC
Add N,1
Next
Next
' For A=0 To 5
' For B=0 To 255
' Doke N,Deek(TS)
' Add TS,2
'Add N,2
'Next
'Next
Screen Open 0,640,256,2,Hires
Curs Off : Flash Off : Cls 0
Colour 1,$FFF
Centre "In a moment you will be prompted for a filename."
Print
Centre "Click on the file you created using the 256TEXTURE program."
Print
Centre "This program will save out a similar file with a .PAL extension."
Print
Centre "Press a key."
Wait Key
Show On
F$=Fsel$("ab3:includes/","newtexturemaps","Select your existing TEXTURE file")
Bsave F$+".PAL",Start(15) To N